<?php
/**
 * Created by PhpStorm.
 * User: yzh
 * Date: 2019/5/22
 * Time: 11:28
 */

namespace app\api\model;


class WorkUserForm extends BaseModel
{

    public $autoWriteTimestamp = true;

    /*** 新增表单
     * @param $uid
     * @param $wu_id
     * @param $content
     * @return false|int
     */
    public function fromSubmission($uid,$wu_id,$content){
        return self::save([
            'type'=>1,
            't_id'=>$uid,
            'wu_id'=>$wu_id,
            'content'=>$content,
        ]);
    }

    /*** 报名预约列表
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function AppointmentUser(){
        return self::table('xhy_work_user_form')
                        ->alias('a')
                        ->join('xhy_work_user b','a.wu_id = b.id')
                        ->field('a.content,a.create_time,b.name,a.id')
                        ->select();
    }




}